{% extends 'home/base.html' %}
{% block title %}Generate Case{% endblock %}
{% block heading %}Generate Case{% endblock %}

{% block body %}
<div class="container">
<div class="row">
  <form class="col s12" action='/case/do_generate/' method="POST">
    {%csrf_token%}
    <div class="row">
      <div class="input-field col s12">
      <select name="appointment" id="appointment" class="validate" required>
         {% for appointment in appointments %}
          <option value='{{appointment.pk}}'>病人：{{appointment.patinet.username}}  挂号单生成时间： {{appointment.appointment_create_time}}  病情描述： {{appointment.description}}</option>
          {% endfor %}
      </select>
      </div>
      <div class="input-field col s12">
        <textarea name="description" id="description" class="materialize-textarea"></textarea>
        <label for="description" >notes</label>
      </div>
      <button type="submit" class="btn">Generate</button>
    </div>
  </form>
</div>
</div>
{% if patients %}<div id="patient-data" hidden>{% for patient in patients %}"{{patient.username}}":null, {% endfor %}</div>{% endif %}
{% endblock %}
